//
//  LWSearchBar.m
//  1.28  weibo
//
//  Created by mac on 15/2/1.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "LWSearchBar.h"

@interface LWSearchBar ()



@end

@implementation LWSearchBar

- (instancetype)initWithFrame:(CGRect)frame{
 
    self = [super initWithFrame:frame];
    [self setup];
    return self;
}
- (id)initWithCoder:(NSCoder *)aDecoder{

    self = [super initWithCoder:aDecoder];
    [self setup];
    return self;
}

- (void)setup{

    self.borderStyle = UITextBorderStyleRoundedRect;
    self.placeholder = @"请输入想要搜索的内容";
    
    UIImageView *icon = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"searchbar_searchlist_search_icon"]];
    self.leftView = icon;
    self.leftViewMode = UITextFieldViewModeAlways;
    self.clearButtonMode = UITextFieldViewModeAlways;
}

- (void)setLeftIconName:(NSString *)leftIconName{
    
    _leftIconName = leftIconName;
    
    UIImageView *leftView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:leftIconName]];
    leftView.width = 30;
    leftView.contentMode = UIViewContentModeCenter;
    
    self.leftView = leftView;
    
    
    
}


@end
